﻿// =================================================================== 
// 项目说明
//====================================================================
// Wup。@Copy Right 2014
// 文件： Applications.cs
// 项目名称：买车网
// 创建时间：2014/7/20
// 负责人：Wup
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Weixin.Entity.ChinaTax;
using Weixin.Utils;


namespace Weixin.DAL.ChinaTax
{
    /// <summary>
    /// 数据层实例化接口类 dbo.Applications.
    /// </summary>
    public partial class ApplicationsDataAccessLayer 
    {
        public IList<ApplicationsEntity> GetApplicationsList(int cid)
        {
            IList<ApplicationsEntity> Obj = new List<ApplicationsEntity>();
            string sqlStr = "select * from Applications where courseId=@CourseId order by CreateTime desc";
            SqlParameter[] para = { new SqlParameter("@CourseId", SqlDbType.Int) };
            para[0].Value = cid;
            using (SqlDataReader dr = SqlHelper.ExecuteReader(WebConfig.ChinaTax, CommandType.Text, sqlStr, para))
            {
                while (dr.Read())
                {
                    Obj.Add(Populate_ApplicationsEntity_FromDr(dr));
                }
            }
            return Obj;
        }

        public IList<ApplicationsEntity> GetApplicationsList(string ids)
        {
            IList<ApplicationsEntity> Obj = new List<ApplicationsEntity>();
            string sqlStr = "select * from Applications where courseId in(" + ids + ") order by CreateTime desc";
            using (SqlDataReader dr = SqlHelper.ExecuteReader(WebConfig.ChinaTax, CommandType.Text, sqlStr))
            {
                while (dr.Read())
                {
                    Obj.Add(Populate_ApplicationsEntity_FromDr(dr));
                }
            }
            return Obj;
        }
	}
}
